package com.bwie.controller;


import com.bwie.pojo.TbPayment;
import com.bwie.service.TbPaymentService;
import com.bwie.utils.R;
import com.bwie.vo.TbPaymentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("tbPayment")
@Api(tags = "支付微服务")
public class TbPaymentController {


    @Autowired
    TbPaymentService tbPaymentService;

    @PostMapping("/addTbPayment")
    @ApiOperation("添加支付")
    public R addTbPayment(@RequestBody TbPaymentVo tbPaymentVo){

       return tbPaymentService.addTbPayment(tbPaymentVo);
    }

    @PostMapping("/tbPaymentList")
    @ApiOperation("支付列表")
    public R tbPaymentList(){
        List<TbPayment> list = tbPaymentService.list();

        return R.ok().data("list",list);
    }

}
